package com.xiongwei.principle.singleresponsibility;

/**
 * 没有对原有类做大的修改，只是增加方法
 * 虽然没有在类的级别遵守单一职责原则，但是在方法级别上，仍然遵守单一职责原则
 */
public class SingerResponsibility3 {

    public static void main(String[] args) {
        new Vehicle2().runAir("飞机");
        new Vehicle2().runRoad("火车");
        new Vehicle2().runWater("船");
    }
}

class Vehicle2 {

    public void runAir(String vehicle) {
        System.out.println(vehicle + "在空中行驶");
    }
    public void runRoad(String vehicle) {
        System.out.println(vehicle + "在路上行驶");
    }

    public void runWater(String vehicle) {
        System.out.println(vehicle + "在水中行驶");
    }
}
